﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CustomTypes.Mono.Serializers
{

    [Serializable]
    public abstract class SerialiserBase
    {


        public static object UnSerialize(string item)
        {
            string[] tb = item.Split(':');
            Type type = Type.GetType(string.Format("{0}, CustomTypes.Mono", tb[0]));
            return tb[1].UnSerializeXml(type);
        }


        public static string Serialize<T>(T item)
        {
            string a = item.SerializeXml<T>();            
            return string.Format("{0}:{1}", typeof(T).FullName, a);
        }
     

    }

}
